<?php

use yii\helpers\Html;
use app\core\lib\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\History */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="box-body">
    <?php $form = ActiveForm::begin([
        'options' => ['class' => 'form-horizontal'],
        'fieldConfig' => [
            'template' => "{label}\n<div class=\"col-lg-8\">{input}</div>\n<div class=\"col-lg-2\">{error}</div>",
            'labelOptions' => ['class' => 'col-lg-1 control-label'],
        ],
    ]); ?>


    <?= $form->field($model, 'title')->widget(\xinyeweb\tagsinputtypeahead\TagsInputTypeahead::className(),[
            'data' => \yii\helpers\ArrayHelper::getColumn(\app\models\Post::find()->asArray()->all(),'title')
    ]) ?>

    <?= $form->field($model, 'time')->widget(\xinyeweb\datetimepicker\Datetimepicker::className(),[
        'phpDatetimeFormat' => 'yyyy-MM-dd',
        'clientOptions' => [
            'minView' => 'month',//只選擇日期
            'language'=> 'zh-CN',
            'format' => 'yyyy-mm-dd',
            'weekStart' => 1,
            'todayBtn' => 1,
            'autoclose' => 1,
            'startDate' => date('Y-m-d'),
            'todayHighlight' => 1,
            'startView' => 2,
            'forceParse' => 0,
            'showMeridian' => 1
        ]
	]) ?>

    <?= $form->field($model, 'pics')->widget(\app\core\widgets\webuploader\WebUploader::className(),[
            'clientOptions' => [
                'pick' => [
                    'multiple' => true,
                ],
            ]
    ]) ?>


    <?= Html::submitButton(Html::tag('span', '', ['class' => 'glyphicon glyphicon-floppy-disk']) . ' ' .
        ($model->isNewRecord ? 'Create' : 'Save'),
        ['class' => $model->isNewRecord ? 'btn btn-success pull-right' : 'btn btn-primary pull-right']) ?>
    <?php ActiveForm::end(); ?>
</div>
<?php $this->render('@app/modules/admin//views/layouts/modal-form', ['form' => $form]) ?>

